<?php
require '../library/system/app.php';

//载入PhpWind配置
//define('D_P', '/WWWROOT/localsites/sudingke.site/htdocs/bbs/');
define('D_P', '/var/www/fangwe/');
require D_P.'data/bbscache/config.php';

//$verify = PhpWind::getVerify();
$act = isset($_GET['act']) ? $_GET['act'] : 'get';

echo '<a href="?act=set">SET</a> | <a href="?act=get">GET</a>';

if($act == 'set'){
    echo '<h2>SET PHPWIND COOKIE</h2>';

    if(isset($_POST['dosubmit']) && $_POST['dosubmit']){
        PhpWind::setCookie('winduser', $_POST['cookie'], time() + 3600);
        echo 'Success!';
    }else{
        echo '<form action="?act=set" method="post">winduser<input type="text" name="cookie" /><input type="submit" name="dosubmit" value="Submit" /></form>';
    }
}else{//
    echo '<h2>GET PHPWIND COOKIE</h2>';
    list($winduid,$windpwd,$safecv) = explode("\t",addslashes(PhpWind::strCode(PhpWind::GetCookie('winduser'),'DECODE')));

    var_dump($winduid);
    var_dump($windpwd);
    var_dump($safecv);
}

?>